package me.firstapp.manage.sku;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import me.firstapp.manage.common.BaseManage;

@Controller
@RequestMapping(value = "/skuManage")
public class SkuManagePage extends BaseManage {

	@RequestMapping(value = "/skuList.html", method = RequestMethod.GET)
	public ModelAndView skuListView(Long productId, HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		modelMap.put("productId", productId);
		return new ModelAndView("sku/skuList", modelMap);
	}

	@RequestMapping(value = "/skuAdd.html", method = RequestMethod.GET)
	public ModelAndView skuAddView(Long productId, HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		modelMap.put("productId", productId);
		return new ModelAndView("sku/skuAdd", modelMap);
	}

	@RequestMapping(value = "/skuUpdate.html", method = RequestMethod.GET)
	public ModelAndView skuUpdateView(Long skuId, String name, HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		modelMap.put("skuId", skuId);
		modelMap.put("name", name);
		return new ModelAndView("sku/skuUpdate", modelMap);
	}
}
